package com.ssy.lingxi.pay.api.fallback;

import com.ssy.lingxi.common.response.ResponseCode;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.pay.api.feign.ICreditControllerFeign;
import com.ssy.lingxi.pay.api.model.vo.request.*;
import com.ssy.lingxi.pay.api.model.vo.response.CreditFeignDetailVO;
import com.ssy.lingxi.pay.api.model.vo.response.CreditPayResponseVO;
import org.springframework.stereotype.Component;

import javax.validation.Valid;

@Component
public class CreditControllerFallback implements ICreditControllerFeign {

    /**
     * 支付能力-初始化授信 会员支付参数配置勾选“授信额度支付”时调用
     * @author 伍将
     * @date 2020/8/27
     * @param initVO: 
     * @return com.ssy.lingxi.common.response.Wrapper
     **/
    @Override
    public Wrapper<Void> init(@Valid CreditInitVO initVO) {
        return Wrapper.fail(ResponseCode.SERVICE_PAY_ERROR);
    }

    /**
     * 查询会员授信
     *
     * @param feignVO 上下级会员Id
     * @return 查询结果，如无授信，返回Null
     */
    @Override
    public Wrapper<CreditFeignDetailVO> findCredit(@Valid CreditFeignVO feignVO) {
        return Wrapper.fail(ResponseCode.SERVICE_PAY_ERROR);
    }

    /**
     * 支付能力-新增会员授信 审批通过会员调用
     * @author 伍将
     * @date 2020/8/27
     * @param creditAddVO:
     * @return com.ssy.lingxi.common.response.Wrapper
     **/
    @Override
    public Wrapper<Void> add(@Valid CreditAddVO creditAddVO) {
        return Wrapper.fail(ResponseCode.SERVICE_PAY_ERROR);
    }

    /**
     * 支付能力-授信支付
     * @author 伍将
     * @date 2020/11/3
     * @param payVO:
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.pay.api.model.vo.response.CreditPayResponseVO>
     **/
    @Override
    public Wrapper<CreditPayResponseVO> pay(@Valid CreditPayVO payVO) {
        return Wrapper.fail(ResponseCode.SERVICE_PAY_ERROR);
    }

    /**
     * 冻结授信
     * @author 伍将
     * @date 2020/12/1
     * @param frozenCreditVO:
     **/
    @Override
    public Wrapper<Void> frozenCredit(@Valid FrozenCreditVO frozenCreditVO) {
        return Wrapper.fail(ResponseCode.SERVICE_PAY_ERROR);
    }

    /**
     * 退款
     * @author 伍将
     * @date 2020/12/9
     * @param refundVO:
     * @return 退款交易号
     **/
    @Override
    public Wrapper<String> refund(@Valid CreditRefundVO refundVO) {
        return Wrapper.fail(ResponseCode.SERVICE_PAY_ERROR);
    }
}
